package me.zhengjie.modules.system.repository;

import me.zhengjie.modules.system.domain.ProjectApproval;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface ProjectApprovalRepository extends JpaRepository<ProjectApproval, Long>, JpaSpecificationExecutor<ProjectApproval> {

    @Query(value = "SELECT * FROM project_aproval where if(?1!='', name=?1, 1=1)", nativeQuery = true)
    List<ProjectApproval> list(String name);
}
